Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@shopify/name
Advanced tools
@shopify/name
[!CAUTION]
@shopify/name
is deprecated.Shopifolk, see Shopify/quilt-internal for information on the latest packages available for use internally.
Utilities for formatting localized names.
yarn add @shopify/name
Formats a name (given name and/or family name) according to the locale. For example:
formatName({name: {givenName: 'John', familyName: 'Smith'}, locale: 'en'})
will return John
in English and Smith様
in JapaneseformatName({name: {givenName: 'John', familyName: 'Smith'}, locale: 'en', options: {full: true}})
will return John Smith
in English and SmithJohn
in JapaneseReturns true
when the provided locale formats family name before given name.
For example:
hasFamilyNameGivenNameOrdering('ja')
will return true
hasFamilyNameGivenNameOrdering('en')
will return false
Takes a name (given and family name) and returns a language appropriate abbreviated name, or will return formatName
if
it is unable to find a suitable abbreviation.
For example:
abbreviateName({name: {givenName: 'John', familyName: 'Smith'}, locale: 'en'})
will return JS
abbreviateName({name: {givenName: '健', familyName: '田中'}, locale: 'en'})
will return 田中
You may also pass an optional idealMaxLength
parameter, which gives the maximum allowable abbreviation length when
trying to abbreviate a name in the Korean language (default 3 characters). In Korean, if the given name is longer than
this length, the method will instead return the first character of the given name.
Takes a business name and returns a language appropriate abbreviated name, or will return the input name if it is unable to find a suitable abbreviation.
For example:
abbreviateBusinessName({name: 'Shopify'})
will return Sho
abbreviateBusinessName({name: 'My Store'})
will return MS
abbreviateBusinessName({name: '任天堂'})
will return 任天堂
You may also pass an optional idealMaxLength
parameter, which gives the maximum allowable abbreviation length when
trying to abbreviate a name.
FAQs
Name-related utilities
The npm package @shopify/name receives a total of 14,164 weekly downloads. As such, @shopify/name popularity was classified as popular.
We found that @shopify/name demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.